<template>
    <!-- 顶部 -->
    <div class="header">
        <div class="header-logo">校园树洞后台管理系统</div>
        <div class="header-m"></div>
        <div class="header-r">
            <el-dropdown>
                <span class="el-dropdown-link">
                    {{user.nickName}}<i class="el-icon-arrow-down el-icon--right"></i>
                </span>
                <el-dropdown-menu slot="dropdown">

                    <el-dropdown-item @click.native="$router.push('/login')">退出系统</el-dropdown-item>
                </el-dropdown-menu>
            </el-dropdown>
        </div>
    </div>
    <!-- 顶部 -->
</template>

<script>
export default {

    data() {
        return {
            user: {},
        }
    },
    mounted() { this.user=JSON.parse(sessionStorage.getItem("user")) 
    this.$bus.$on('nn',(data)=>{
      console.log('我是School组件.我收到了数据',data);
      this.user.nickName=date;
//接收的一方完成之后，最好解绑某一个事件
    })},
};
</script>

<style scoped>
.header {
    height: 50px;
    line-height: 50px;
    /* width: 50px; */
    display: flex;
    border-bottom: 1px solid rgb(230, 230, 230);
    /* background: orange; */
}

.header-logo {
    width: 200px;
    color: dodgerblue;
    padding-left: 40px;
    font-size: 20px;
    /* font-weight: bold; */
}

.header-m {
    flex: 1;
}

.header-r {
    width: 100px;
}
</style>